using SmartLink.EnumLibrary;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;

namespace SmartLink.DTOS.Account
{
    /// <summary>
    /// 添加用户信息模型
    /// </summary>
    public class AddUserDTO
    {
        /// <summary>
        /// 账号
        /// </summary>
        [Required(ErrorMessage = "账户名不能为空")]
        [StringLength(50, MinimumLength = 6, ErrorMessage = "账户名必须在6-50个字符")]
        public string AccountName { get; set; }

        /// <summary>
        /// 昵称
        /// </summary>
        [Required(ErrorMessage = "姓名不能为空")]
        [MaxLength(50, ErrorMessage = "姓名最多50个字符")]
        public string NickName { get; set; }

        /// <summary>
        /// 所属公司
        /// </summary>
        [Required]
        public int OID { get; set; }

        /// <summary>
        /// 关联部门
        /// </summary>
        public int? DeptId { get; set; }

        /// <summary>
        /// 工号
        /// </summary>
        [MaxLength(50, ErrorMessage = "工号最多50个字符")]
        public string JobNo { get; set; }

        /// <summary>
        /// 性别
        /// </summary>
        public SexEnum Sex { get; set; } = SexEnum.Secret;

        /// <summary>
        /// 手机
        /// </summary>
        [RegularExpression(RegexPattern.MobilePhone, ErrorMessage = "手机号码格式错误")]
        public string UserMobile { get; set; }

        /// <summary>
        /// 电话
        /// </summary>
        [RegularExpression(RegexPattern.Phone, ErrorMessage = "电话号码格式错误")]
        public string UserPhone { get; set; }

        /// <summary>
        /// 电子邮箱
        /// </summary>
        [RegularExpression(RegexPattern.Email, ErrorMessage = "电子邮箱格式错误")]
        public string UserEmail { get; set; }

        /// <summary>
        /// 生日
        /// </summary>
        public DateTime? Birthday { get; set; }

        /// <summary>
        /// QQ
        /// </summary>
        [RegularExpression(RegexPattern.QQ, ErrorMessage = "QQ号码格式错误")]
        public string QQ { get; set; }

        /// <summary>
        /// 微信
        /// </summary>
        [RegularExpression(RegexPattern.WeChat, ErrorMessage = "微信号格式错误")]
        public string WeChat { get; set; }

        /// <summary>
        /// 状态
        /// </summary>
        public UserStatusEnum UserStatus { get; set; } = UserStatusEnum.启用;
    }
}
